'\" te
.\" Copyright (c) 2006, Sun Microsystems, Inc.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH INB 9F "September 12, 2020"
.SH NAME
inb, inw, inl \- read from an I/O port
.SH SYNOPSIS
.nf
#include <sys/ddi.h>
#include <sys/sunddi.h>

\fBunsigned char\fR \fBinb\fR(\fBint\fR \fIport\fR);
.fi

.LP
.nf
\fBunsigned short\fR \fBinw\fR(\fBint\fR \fIport\fR);
.fi

.LP
.nf
\fBunsigned long\fR \fBinl\fR(\fBint\fR \fIport\fR);
.fi

.SH INTERFACE LEVEL
The functions described here are obsolete. For the \fBinb()\fR, \fBinw()\fR,
and \fBinl()\fR functions, use, respectively, \fBddi_get8\fR(9F),
\fBddi_get16\fR(9F), and \fBddi_get32\fR(9F) instead.
.SH PARAMETERS
.ne 2
.na
\fB\fIport\fR\fR
.ad
.RS 9n
A valid I/O port address.
.RE

.sp
.ne 2
.na
\fB\fIaddr\fR\fR
.ad
.RS 9n
The address of a buffer where the values will be stored.
.RE

.sp
.ne 2
.na
\fB\fIcount\fR\fR
.ad
.RS 9n
The number of values to be read from the I/O port.
.RE

.SH DESCRIPTION
These routines read data of various sizes from the I/O port with the address
specified by \fIport\fR.
.sp
.LP
The \fBinb()\fR, \fBinw()\fR, and \fBinl()\fR functions read 8 bits, 16 bits,
and 32 bits of data respectively, returning the resulting values.
.SH RETURN VALUES
The \fBinb()\fR, \fBinw()\fR, and \fBinl()\fR functions return the value that
was read from the I/O port.
.SH CONTEXT
These functions may be called from user, interrupt, or kernel context.
.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Architecture	x86
_
Stability Level	 Obsolete
.TE

.SH SEE ALSO
.BR isa (5),
.BR attributes (7),
.BR ddi_get16 (9F),
.BR ddi_get32 (9F),
.BR ddi_get8 (9F),
.BR outb (9F)
.sp
.LP
\fIWriting Device Drivers\fR
